package kr.hkit.androidcomplete01.ch06;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.Button;
import android.widget.LinearLayout;

public class MarginParameter2Ex extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		LinearLayout linear = new LinearLayout(this);
		linear.setOrientation(LinearLayout.VERTICAL);
		linear.setBackgroundColor(Color.LTGRAY);
		
		Button btn = new Button(this);
		btn.setText("Button With Margin");
		
		LinearLayout.LayoutParams parambtn = new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.WRAP_CONTENT,
				LinearLayout.LayoutParams.MATCH_PARENT
				);
		
		parambtn.setMargins(0, 30, 0, 30);
		linear.addView(btn, parambtn);
		
		setContentView(linear);
		
	}
}
